/**
 * 
 */
package hr.fer.zemris.rznu.model.dao;





import hr.fer.zemris.rznu.model.betting.BettingEvent;

import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.cfg.Environment;
import org.hibernate.tool.hbm2ddl.SchemaExport;

/**
 * @author Dajan
 *
 */
public class ExportSchema {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		AnnotationConfiguration configuration = new AnnotationConfiguration();

		configuration.addAnnotatedClass(BettingEvent.class)
		.setProperty(Environment.USER, "vb_user")
		.setProperty(Environment.PASS, "vb_pass")
		.setProperty(Environment.URL, "jdbc:mysql://localhost/vbdb?autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=utf-8")
		.setProperty(Environment.DIALECT, "org.hibernate.dialect.MySQLInnoDBDialect")
		.setProperty(Environment.DRIVER, "com.mysql.jdbc.Driver");

		SchemaExport schema = new SchemaExport(configuration);
		schema.setOutputFile("schema.sql");

		schema.create(true, true);
	}

}
